<%-- 
    Document   : ##count
    Created on : Dec 29, 2014, 12:07:09 AM
    Author     : Tran Thuy Duong
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"
        import="" %>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
        
        <SCRIPT LANGUAGE=VBScript RUNAT=Server>
        Sub Application_OnStart
                Application("visits") 
                Application("Active") = 0
        End Sub

        Sub Application_OnEnd

        End Sub

        Sub Session_OnStart
                Session.Timeout = 30
                Session("Start") = Now
                Application.Lock
                        Application("visits") = Application("visits") + 1
                        intTotal_visitors = Application("visits")
                Application.Unlock
                Session("VisitorID") = intTotal_visitors

                Application.Lock
                        Application("Active") = Application("Active") + 1
                Application.Unlock
        End Sub

        Sub Session_OnEnd			
                Application.Lock
                        Application("Active") = Application("Active") - 1
                Application.Unlock
        End Sub		

    </SCRIPT>

        
    </head>
    <body>
        <h1>Lươt truy cap</h1>
        <Table cellpadding="0" border="2">
            <TR VALIGN=TOP ALIGN=LEFT>
               <TD WIDTH=730 BGCOLOR="#CCCCCC"><P ALIGN=RIGHT><FONT COLOR = '#003366'>
                    <B>  Total Visits&nbsp;&nbsp; <%= Session("VisitorID")%>&nbsp;&nbsp; /&nbsp;&nbsp;
                Visitors Online&nbsp;&nbsp;<%= Application("Active")%>&nbsp;&nbsp; /&nbsp;&nbsp; 
                You Logged on at&nbsp;&nbsp; <%= Session("Start")%></B>

               </TD>
            </TR>
</Table>
    </body>
</html>
